using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

using DataTransferObject;
using Business;
namespace Presentation.UserControlls
{
    public partial class UC_MuonItNhat : UserControl
    {
        clsThuThuBUS ThuThuBUS = new clsThuThuBUS();
        DataTable tbl = new DataTable();

        public UC_MuonItNhat()
        {
            InitializeComponent();
        }

        private void UC_MuonItNhat_Load(object sender, EventArgs e)
        {
            tbl = ThuThuBUS.SachBUS.ThongKeSachMuonItNhat ();
            HienThiListView(tbl);
        }

        private void HienThiListView(DataTable tbl)
        {
            ListViewItem lvwitem = new ListViewItem();
            lvwthongkeanpham.Items.Clear();
            foreach (DataRow dr in tbl.Rows)
            {

                lvwitem = new ListViewItem();
                lvwitem.Text = dr["DKCB"].ToString();
                lvwitem.SubItems.Add(dr["TenTuaSach"].ToString());
                lvwitem.SubItems.Add(dr["SoLuong"].ToString());

                lvwthongkeanpham.Items.Add(lvwitem);
            }


        }

        private void buttonX2_Click(object sender, EventArgs e)
        {
            DialogResult dr = new DialogResult();
            dr = DevComponents.DotNetBar.MessageBoxEx.Show("Bạn Có Muốn Thoát Không", "Thông Báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dr == DialogResult.OK)
            {
                this.ParentForm.Close();
            }
        }
    }
}
